
package de.berlin.fu.inf.nbi.rdflinda.numbers;

import org.nlogo.api.*;

/**
 * @author Daniel Graff Wrapper class for random int values
 */
public class RandomInt
extends AbstractRandomNumber
{

    /**
     * Returns a random int value
     * 
     * @param args
     *            The arguments
     * @param arg1
     *            The context
     * @return Returns a random int value
     * @throws ExtensionException
     *             The exception
     * @throws LogoException
     */
    public Double report(Argument args[], Context arg1)
    throws ExtensionException, LogoException {
        int base = args[0].getIntValue();
        int result = secureRandom.nextInt(base);
        return Double.valueOf(result);
    }
}
